const mongoose = require('mongoose')

const Schema = mongoose.Schema
// 便签表
const TelephoneType = {
    userId: { type: Schema.Types.ObjectId, ref: 'user' }, // 用户id
    fId: { type: Schema.Types.ObjectId, ref: 'user' }, // 发起者id
    toId: String, // 好友id/群id 也可以理解为房间id
    chatType: String, // 聊天类型
    type: String, // 通话类型
    startTime: Date // 通话发起时间
}

const TelephoneModel = mongoose.model('telephone', new Schema(TelephoneType))

module.exports = TelephoneModel